package com.leyu.mall.service.cms.impl;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.leyu.mall.common.facade.ICmsSlideFacade;
import com.leyu.mall.dao.cms.CmsSlideMapper;
import com.leyu.mall.domain.cms.CmsSlide;
import com.leyu.mall.service.cms.ICmsSlideService;

@Service
@Transactional(rollbackFor=Exception.class)
public class CmsSlideServiceImpl implements ICmsSlideService,ICmsSlideFacade{
	
	@Resource(name="cmsSlideMapper")
	private CmsSlideMapper cmsSlideMapper;
	

	public CmsSlide getCmsSlideById(Long entity_id)  throws Exception{
		return cmsSlideMapper.getCmsSlideById(entity_id);
	}

	public void save(CmsSlide entity) throws Exception{
		if(entity.getSlideid()== null){
			cmsSlideMapper.addCmsSlide(entity);
			
		}
		else{
		
			cmsSlideMapper.updateCmsSlide(entity);
		}
 
	}
	public void deleteCmsSlide(Long  id)throws Exception{
		cmsSlideMapper.deleteCmsSlide(id);
	}
	public List<CmsSlide> getAllCmsSlide()throws Exception{
		 
 
		return cmsSlideMapper.getAllCmsSlide();
		
	}
	
	public List<CmsSlide> getDisplaySlideList() throws Exception{
		return cmsSlideMapper.getDisplaySlideList();
	}
}